/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package researchgrants.parts.GrantRequest.statusChanges;

import java.awt.Window;
import java.awt.event.ActionListener;
import researchgrants.parts.GrantRequest.GrantRequest;

/**
 * A GrantRequestStatusChange for Cancelled grants.
 * Contains nothing
 * @author DOStudent1
 */
public class GrantRequestStatusChangeCompleted extends GrantRequestStatusChange {
    // unique identifiers
    final public static String dbString="Completed";
    final public static String headerCaption="Completion";

    static public GrantRequestStatusChangeCompleted getByStatusChangeId(int statusChangeID) {
        return(new GrantRequestStatusChangeCompleted(statusChangeID));
    }

    // This function creates a new completion and adds it to the given grantRequest.
    static public GrantRequestStatusChangeCompletedView inputNew(Window parent, GrantRequest grantRequest, ActionListener savedActionListener, ActionListener cancelActionListener) {
        GrantRequestStatusChangeCompletedView newView=new GrantRequestStatusChangeCompletedView(parent, grantRequest, savedActionListener, cancelActionListener);
        return(newView);
    }

    private GrantRequestStatusChangeCompleted(int statusChangeId) {
        super(statusChangeId);
        syncDataFromDb();
    }

    
    // populate the fields from the database
    private void syncDataFromDb() {
        // no data currently - no need to sync with db
    }

    // Returns a view for the StatusChangeAwarded
    public GrantRequestStatusChangeView getView(Window parent) {
        return(new GrantRequestStatusChangeCompletedView(parent, this));
    }

    ///////////////////////////////////////////
    // return the type specific identifiers
    ///////////////////////////////////////////

    public String getStatusChangeTitle() {
        return(headerCaption);
    }

    public String getStatusChangeCode() {
        return(dbString);
    }
    
    
    
}
